package com.neuedu.hostp.serivice.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.hostp.dao.CheckinMapper;
import com.neuedu.hostp.entity.Checkin;
import com.neuedu.hostp.service.CheckinService;

@Service
public class CheckinServiceImpl implements CheckinService {
	@Autowired
	CheckinMapper checkinMapper;
	
	@Override
	public boolean insert(Checkin checkin) {
		int line = checkinMapper.insertSelective(checkin);
		return line==1?true:false;
	}

	@Override
	public boolean update(Checkin checkin) {
		int line = checkinMapper.updateByPrimaryKeySelective(checkin);
		return line==1?true:false;
	}

	@Override
	public boolean delete(Integer id) {
		int line = checkinMapper.deleteByPrimaryKey(id);
		return line==1?true:false;
	}

	@Override
	public Checkin selectById(Integer id) {
		return checkinMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Checkin> selectAll() {
		return checkinMapper.selectAll();
	}

}
